package com.matt.foundation.vo;

import com.matt.foundation.utils.DateUtil;
import lombok.Data;

import java.util.Date;


/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/9/19
 * *******************************
 */
@Data
public class AdviseListVo {
    private String childrenId;
    private String childrenName;
    private Integer gender;
    private String birthday;
    private String adviseContent;

    public static AdviseListVo of(Object[] objects) {
        AdviseListVo vo = new AdviseListVo();
        vo.setChildrenId(objects[0] == null ? "" : objects[0].toString());
        vo.setChildrenName(objects[1] == null ? "" : objects[1].toString());
        vo.setGender(objects[2] == null ? 0 : Integer.valueOf(objects[2].toString()));
        vo.setBirthday(objects[3] == null ? "" : DateUtil.millisToDateTime(((Date)objects[3]).getTime(), "yyyy-MM-dd"));
        vo.setAdviseContent(objects[4] == null ? "" : objects[4].toString());
        return vo;
    }
}
